-include ../Makefile.rules

SRC=	main_jdv.cc \
	jdv.cc \
	MyErrors.cc\
	case.cc\
	map.cc\
	team.cc\
	ant.cc\
	ant_fighter.cc\
	ant_queen.cc\
	ant_worker.cc\
	printer.cc\
	my_random.cc

HEAD=	MyErrors.hh\
	ant_fighter.hh\
	ant_type.hh\
	case.hh\
	map.hh\
	ant.hh\
	ant_queen.hh\
	ant_worker.hh\
	jdv.hh\
	team.hh\
	my_random.hh

OBJ=$(SRC:.cc=.o)

EXE=jdv

all:    ${EXE}

check: all

$(EXE):	 deps $(OBJ)
	$(CC)  ${OBJ} $(LDFLAGS) -o ../${EXE}

.cc.o:
	$(CC) $(CFLAGS) -o $@ -c $<

deps: $(SRC) ${HEAD}
	$(CC) -MM $(SRC) > deps

-include deps

clean:
	-rm -rf *.o
	-rm -rf *~

distclean: clean
	-rm -rf ../${EXE}
	rm -f deps

.PHONY: clean distclean
